package com.zttek.photosShareProject.modules.service.share;

import com.zttek.photosShareProject.common.json.ImageVO;
import com.zttek.photosShareProject.common.myException.DBException;
import com.zttek.photosShareProject.modules.model.Image;
import com.zttek.photosShareProject.modules.model.Share;
import com.zttek.photosShareProject.modules.model.User;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

/**
 * Created by 13296 on 2017/8/29.
 */
public interface IImageService {

    /**
     * 新上传图片
     * @param type 文件格式
     * @param path *
     * @param thumbPath *
     * @param userId 上传者用户id
     * @return *
     */
    Image newImage(String type, String path, String thumbPath, Long userId, String md5) throws Exception;

    /**
     * 查--根据字符串ids获取Iamge实体list
     * @param idsString *
     * @return *
     * @throws DBException *
     */
    List<Image> selectImagesByIds(String idsString)throws Exception;

    Image selectImageById(Long id)throws Exception;

    /**
     * 非物理删除
     * @param id *
     * @throws DBException *
     */
    void deleteImageById(Long id) throws Exception;

    Image checkMd5(String md5) throws Exception;

    ImageVO image2VO(Image image, boolean withUser) throws Exception;

    List<ImageVO> image2VO(List<Image> images, boolean withUser) throws Exception;

    /**
     * 获取上传图片的md5值
     * @param multipartFile
     * @return
     * @throws Exception
     */
    String getImageMD5Val(MultipartFile multipartFile)throws Exception;
}
